<?php

App::uses('AppController', 'Controller');

class SesionController extends AppController {

    public function beforeFilter()
    {
        parent::beforeFilter();
        $this->Auth->allow();
    }

    public function ingresar()
    {  
        if ($this->request->is('post'))
        {
            if ($this->Auth->login())
            {
                $this->redirect($this->Auth->redirectUrl());
            }
            else {
                $this->set('errorLog', true);
            }
        }
            
    }

    public function salir()
    {
        $this->Auth->logout();
        $this->redirect(array('controller' => 'Principal', 'action' => 'index'));
    }

    public function rechazado()
    {
        
    }

}
